/**
* The interface that must be implemented by all plugin components wishing to plug into the main Admin Desktop
* perspective-viewing area.
*/
 jsx3.lang.Class.defineInterface("ux.core.plugin.SelectPerspectiveInterface",
    ux.core.plugin.PluginInterface,
    function(plugin) {

        /**
        * {Function} the function to callback on once the secondary selecion has been performed.  Used by the
        * <code>notifyParent()</code> function.<br /><br />
        * Set by it's parent plugin container.
        * @private
        * @jsxobf-clobber
        */
        plugin.prototype.selectionCallback = null;

        /**
        * {Object} the target object whose <code>selectionCallback</code> function will be called when the secondary
        * selection has been completed.  Used by the <code>notifyParent()</code> function.<br /><br />
        * Set by it's parent plugin container.
        * @private
        * @jsxobf-clobber
        */
        plugin.prototype.callbackTarget = null;

        /**
        * Abstract interface function to to be implemented by plugin components to return the text to be added
        * to the perspective select box.
        *
        * @return {String} the text to add into the select box
        */
        plugin.prototype.getSelectText = jsx3.lang.Method.newAbstract() ;

        /**
        * Abstract method to be implemented by plugin components.<br /><br />
        * Called by the parent plugin container to allow the plugin component to load it's content into the third
        * extension point's content area (the main perspective viewing area).<br /><br />
        * Parent plugin containers will call this after a secondary selection has been performed, and the plugin
        * component has given notification of that selection via the <code>notifyParent()</code> function.<br /><br />
        * The parent container will also be sure that previous content in the block is removed first.<br /><br />
        * This plugin's secondary selection UI will be loaded in the <code>loadComponent()</code> function of the
        * <code>ux.core.plugin.PluginInterface</code> interface.
        *
        * @param parent {jsx3.gui.Painted} the parent object to load the content into.  Plugin components are advised to
        *               use the <code>ux.core.System.loadUIResourceAsync</code> function to do the content loading,
        *               or the <code>ux.core.System.loadUIResource</code> function if that is not possible.
        * @param selection {Object} an object containing the selection made in the secondary selection.
        */
        plugin.prototype.loadStage2Component = jsx3.lang.Method.newAbstract("parent","selection") ;

        /**
        * Pre-implemented function that should NOT be overridden by the plugin component.  The plugin component
        * should call this function on themselves once their secondary selection has been completed.
        *
        * @param id {Object} an object containing the selection made in the secondary selection.  This may be any object
        *           type the plugin wishes: it will be returned to them in the <code>loadStage2Component()</code>
        *           function call.
        */
        plugin.prototype.notifyParent = function(id) {
            var arr = null;
            if(id) {
                arr = new Array();
                arr.push(id);
            }
            this.selectionCallback.call(this.callbackTarget, arr);
        }

        /**
        * Abstract method to be inplemented by plugin components<br /><br />
        * Called by the parent plugin container to get the text to be displayed to the left of the secondary selection area.
        *
        * @return {String} the secondary selection area's label text
        */
        plugin.prototype.getSecondarySelectionText = jsx3.lang.Method.newAbstract();

        /**
        * Abstract method to be implemented by plugin components.<br /><br />
        * Called by the parent plugin container to get the Section Title text for a given secondary selection.
        *
        * @param selection {Object} an object containing the selection made in the secondary selection.
        *
        * @return {String} the section title text for a given secondary selection.
        */
        plugin.prototype.getSectionTitle = jsx3.lang.Method.newAbstract("selection");


        /**
        * Option method that called by the parent plugin container to get an image path for the plug-in components.
        *
        * @return {String} the related path to the icon image file.
        */
        if(!plugin.prototype.getIconPath) {
            plugin.prototype.getIconPath = function() {
                return ux.core.System.getServer().getDynamicProperty("@uxcore10@Default Perspective Icon");
            }
        }

        /**
        * Option method that called by the parent plugin container to get the description for the plug-in components.
        *
        * @return {String} the descript for what the plug-in component's functionality.
        */
        if(!plugin.prototype.getDescription) {
            plugin.prototype.getDescription = function() {
                return "";
            }
        }

   }
 );